package xmltest;

import java.util.ArrayList;
import java.util.List;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import entity.general.Pair;

public class ListXMLConverter //<S> implements XMLConverter <List <S>>
{
	/*
	private XMLConverter <S> itemConverter;
	static String tagName = "List";

	public ListXMLConverter (XMLConverter <S> itemConverter)
	{
		this.itemConverter = itemConverter;
	}
	
	public Pair <List <S>, String> getObject(Node node)
	{
		if(!node.getNodeName().equals(tagName))
		{
			throw new XMLParseException(node.getNodeName() + " != " + tagName);
		}
		String id = node.getAttributes().getNamedItem("id").getTextContent();

		List <S> list = new ArrayList <S>();
		NodeList children = node.getChildNodes();
		for(int i = 0; i < children.getLength(); i++)
		{
			S obj = itemConverter.getObject(children.item(i));
			list.add(obj);
		}		
		return new Pair <List <S> , String> (list, id);
	}
	
	public String toXML(String name, S object)
	{
		String xml = "";
		xml += "<" + tagName + " id='" + name + "'>\n";
		
		xml += "</" + tagName + ">\n";

	}
	
	public String getTagName()
	{
		return tagName;
	}
*/
}
